import { ProColumns } from '@ant-design/pro-components'
import { Key } from 'react'
import { ProZoomTable } from '@zoom-design/zoom-design-demo'

interface DataType {
  key: Key,
  orderId?: string,
  orderDate?: number,
  orderStatus?: string,
}

const columnsInit: ProColumns<DataType>[] = [
  {
    title: '数据主键',
    dataIndex: 'orderId',
    key:  'orderId',
    width: 100,
    search: false
  },
  {
    key: 'orderDate',
    title: 'orderDate',
    dataIndex: 'orderDate',
    width: 200,
    valueType: 'dateTime'

  },
  {
    key: 'orderStatus',
    title: 'orderStatus',
    dataIndex: 'orderStatus',
    width: 200,
    valueEnum: {
      all: { text: '全部' },
      'open': {
        text: '打开',
        status: 'finish'
      },
      close: {
        text: '关闭',
        status: 'Default'
      },
      cancel: {
        text: '取消',
        status: 'Default'
      }
    }
  }
]

const Warehouse = () => {
  return (
    <>
      <ProZoomTable<DataType>
        rowKey={'orderId'}
        columns={columnsInit}
        url={'/es/query'}
        options={false}
      />
    </>
  )
}

export default Warehouse